<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>{$pagetitle}</title>
        <meta name="renderer" content="webkit" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <link rel="stylesheet" href="/static/admin/layuiadmin/layui/css/layui.css" media="all" />
        <link rel="stylesheet" href="/static/admin/css/admin_global.css" />
        <link rel="stylesheet" href="/static/admin/plugin/select2/css/select2.min.css" />
        <!--公共必要的JS-->
        <script src="/static/admin/js/check.js"></script>
        <script src="/static/admin/layuiadmin/layui/layui.js"></script>
        <script src="/static/js/jquery-3.6.2.min.js"></script>
        <script src="/static/js/crypto-js.min.js"></script>
        <script src="/static/admin/js/global.js"></script>
        <!--省市区-->
        <script src="/static/admin/plugin/shengshiqu/distpicker.data.js"></script>
        <script src="/static/admin/plugin/shengshiqu/distpicker.js"></script>
        <!--编辑器开始-->
        <script src="/static/admin/plugin/ueditor/ueditor.config.js"></script>
        <script src="/static/admin/plugin/ueditor/ueditor.all.js"></script>
        <!--编辑器结束-->
        <!---百度地图-->
        <script src="/static/admin/plugin/baidumap/setpoint.js"></script>
        <!--文件上传 start-->
        <script src="/static/admin/plugin/webuploader/kinderfile.js"></script>
        <script src="/static/admin/plugin/webuploader/Sortable.js"></script>
        <script src="/static/admin/plugin/webuploader/morepic.js"></script>
        <!--以下是针对 快速上传单个文件插件-->
        <link rel="stylesheet" href="/static/admin/plugin/webuploader/style/webuploader.css" />
        <link rel="stylesheet" href="/static/admin/plugin/webuploader/style/style.css" />
        <script src="/static/admin/plugin/webuploader/webuploader.min.js"></script>
        <script src="/static/admin/plugin/webuploader/fastupimg.js"></script>
        <!--文件上传 end-->
        <!--文件上传的预览功能中中也需要用到我 fancybox plus start-->
        <link rel="stylesheet" href="/static/admin/plugin/fancybox/jquery.fancybox-1.3.4.vot.css" />
        <script src="/static/admin/plugin/fancybox/jquery.fancybox-1.3.4.vot.js"></script>
        <!--文件上传的预览功能中中也需要用到我 fancybox plus end-->
        <!--select2 js start-->
        <link rel="stylesheet" href="/static/admin/plugin/select2/css/select2.min.css" />
        <script src="/static/admin/plugin/select2/js/select2.full.min.js"></script>
        <!--select2 js end-->
    </head>
    <body>
        <form action="{:url()}" class="layui-form layui-form-pane padding-top-20" method="post" onsubmit="return save_form(this,successFun);">
            <div class="layui-card">
                <div class="layui-card-body" style="padding-bottom: 80px">
                    <div id="content-wrapper" style="width: 80%;margin-left: 5%">
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="new_orders__name" id="new_orders__name" autocomplete="false" class="layui-input" placeholder="请输入名称" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">会员</label>
                            <div class="layui-input-block">
                                <select name="new_orders__member_id" id="new_orders__member_id" autocomplete="false" class="select2" lay-ignore style="width: 100%;">
                                    <option value="">请选择</option>
                                    {foreach $new_orders__member_id_options as $option} 
                                    <option value="{$option.id}">{$option.name}</option>
                                    {/foreach} 
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">支付方式</label>
                            <div class="layui-input-block">
                                <input type="text" name="new_orders__payment_method" id="new_orders__payment_method" autocomplete="false" class="layui-input" placeholder="请输入支付方式" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">支付时间</label>
                            <div class="layui-input-block">
                                <input type="text" name="new_orders__payment_time" id="new_orders__payment_time" autocomplete="false" class="layui-input form-date" readonly placeholder="请选择支付时间" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">产品类型</label>
                            <div class="layui-input-block">
                                <input type="text" name="new_orders__product_type" id="new_orders__product_type" autocomplete="false" class="layui-input" placeholder="请输入产品类型" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">产品id</label>
                            <div class="layui-input-block">
                                <select name="new_orders__product_id" id="new_orders__product_id" autocomplete="false" class="select2" lay-ignore style="width: 100%;">
                                    <option value="">请选择</option>
                                    {foreach $new_orders__product_id_options as $option} 
                                    <option value="{$option.id}">{$option.name}</option>
                                    {/foreach} 
                                </select>
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">购买类型</label>
                            <div class="layui-input-block">
                                <input type="text" name="new_orders__purchase_type" id="new_orders__purchase_type" autocomplete="false" class="layui-input" placeholder="请输入购买类型" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">购买天数</label>
                            <div class="layui-input-block">
                                <input type="text" name="new_orders__purchase_days" id="new_orders__purchase_days" autocomplete="false" class="layui-input" placeholder="请输入购买天数" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">每天价格</label>
                            <div class="layui-input-block">
                                <input type="text" name="new_orders__daily_price" id="new_orders__daily_price" autocomplete="false" class="layui-input" placeholder="请输入每天价格" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">总金额</label>
                            <div class="layui-input-block">
                                <input type="text" name="new_orders__total_amount" id="new_orders__total_amount" autocomplete="false" class="layui-input" placeholder="请输入总金额" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">支付金额</label>
                            <div class="layui-input-block">
                                <input type="text" name="new_orders__payment_amount" id="new_orders__payment_amount" autocomplete="false" class="layui-input" placeholder="请输入支付金额" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">支付详情</label>
                            <div class="layui-input-block">
                                <div class="news_editor" editor_name="new_orders__payment_details" editor_width="100%" editor_height="800" imgwidth="" imgheight="">
                                    <script id="new_orders__payment_details" name="new_orders__payment_details" type="text/plain">{$r?htmlspecialchars_decode($r['new_orders__payment_details']):''}</script>
                                </div>
                                远程图片保存本地 
                                <input type="checkbox" name="new_orders__payment_details_saveFile" lay-ignore value="1" checked />
                                   提取第一张图做为缩略图（如果缩略图为空的情况下） 
                                <input type="checkbox" lay-ignore name="new_orders__payment_details_getFirstImg" value="1" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">产品参数</label>
                            <div class="layui-input-block">
                                <input type="text" name="new_orders__product_parameters" id="new_orders__product_parameters" autocomplete="false" class="layui-input" placeholder="请输入产品参数" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">是否支付</label>
                            <div class="layui-input-block">
                                {foreach $new_orders__is_payment_options as $option} 
                                <input name="new_orders__is_payment" type="radio" value="{$option.id}" title="{$option.name}" />
                                {/foreach} 
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">订单编号</label>
                            <div class="layui-input-block">
                                <input type="text" name="new_orders__order_number" id="new_orders__order_number" autocomplete="false" class="layui-input" placeholder="请输入订单编号" />
                            </div>
                        </div>
                        <div class="layui-form-item" style="position: relative">
                            <label class="layui-form-label">是否申请发票</label>
                            <div class="layui-input-block">
                                {foreach $new_orders__is_apply_for_invoice_options as $option} 
                                <input name="new_orders__is_apply_for_invoice" type="radio" value="{$option.id}" title="{$option.name}" />
                                {/foreach} 
                            </div>
                        </div>
                        <?php
$pubid = make_pubid();
?>
                            <input type="hidden" value="{$pubid }" name="new_orders__pubid" />
                            <input type="hidden" value="{$pubid }" name="pubid" />
                        </div>
                        <div class="flex-center submit-footer">
                            <button class="layui-btn" type="submit" lay-submit id="layui-submit-btn">立即提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary close">关闭</button>
                        </div>
                    </div>
                </div>
            </form>
            <script>
    $(function () {
        //循环实例化编辑器
        $(".news_editor").each(function(){
            var editor_name=$(this).attr("editor_name");
            var editor_width=$(this).attr("editor_width");
            var editor_height=$(this).attr("editor_height");
            var imgwidth=$(this).attr("imgwidth");
            var imgheight=$(this).attr("imgheight");
            var ue = UE.getEditor(editor_name, {
                initialFrameHeight: editor_height>0?editor_height:"0",
                initialFrameWidth: editor_width>0?editor_width:'100%',
                zIndex:1,
                imgwidth: imgwidth,
                imgheight: imgheight,
            });
            //启用抓取微信文章功能
            if(editor_name=="newstext"){
                $(".subWxCrawler").show();
            }
        })

    })
</script>
            <!--编辑器结束-->
            <!---百度地图-->
            <script>
    $(".baidu_map_field").each(function(){
        var baidu_map=new baidumap();
        baidu_map.map_search_value_id=$(this).find(".map_search_value").attr("id");
        baidu_map.map_search_button_id=$(this).find(".map_search_button").attr("id");
        baidu_map.map_field_id=$(this).find(".map_point").attr("id");
        baidu_map.map_show_id=$(this).find(".map_show").attr("id");
        baidu_map.showPoint=0;//如果修改信息的话需要显示之前的标记，这里请设置1  增加信息设置0
        //启动地图显示区方法
        baidu_map.newmap();
        //启动地址模糊搜索方法
        baidu_map.map_search();
        //启动鼠标点击拾取坐标方法
        baidu_map.map_position();
    })
</script>
            <script>
    $(function(){
        $(".thischeck_all").click(function(){
            var y=$(this).attr("val");
            var objname=$(this).attr("objname");
            if(y==0){
                $("."+objname).prop("checked", false);
                y=1;
            }else if(y==1){
                $("."+objname).prop("checked", true);
                y=0;
            }
            $(this).attr("val",y);
        })
    })

    //排序
    function update_order(obj,inputname){
        $("input[name='"+inputname+"']").val($(obj).val());
    }
    //layer


    let laydate = layui.laydate;
    let form = layui.form;
    //时间控件
    $(".form-date").each(function(){
        let dataFormat=$(this).data("format");
        let type = $(this).data('type');
        dataFormat=dataFormat?dataFormat:"yyyy-MM-dd";
        type = type ? type : 'date'
        laydate.render({
            type: type,
            elem:this,
            calendar: true,
            trigger: 'click',
            format: dataFormat //可任意组合
        });
    });

    $(".form-time").each(function(){
        let dataFormat=$(this).data("format");
        let type = $(this).data('type');
        dataFormat=dataFormat?dataFormat:"yyyy-MM-dd HH:mm:ss";
        type = type ? type : 'datetime'
        laydate.render({
            type: type,
            elem:this,
            calendar: true,
            trigger: 'click',
            format: dataFormat //可任意组合
        });
    });

    $('.select2').select2();

    //模型切换
    function urlgo(obj){
        $val=$(obj).val();
        window.location.href='/admin/Cat/add.html?modelid='+$val;
    }

    //多值字段
    function morevalue_add(obj,str){
        var randStr2=randStr();
        for (var i=0; i<30;i++){
            //一次替换三次randImgId，因为一个上传窗口需要替换id="randImgId" 和button里的selectfile('randImgId','','img','','')
            if(i%3==0){
                randStr2=randStr();
            }
            str = str.replace('randImgId',"img_"+randStr2);
            str = str.replace('randFileId',"file_"+randStr2);
            str = str.replace('randVideoId',"video_"+randStr2);
        }
        $(obj).parents("tr").after(str);
    }
    function morevalue_del(obj){
        var len=$(obj).parents("tbody").children().length;
        if(len==1){
            alert("至少要保留一行数据");
            return false;
        }
        $(obj).parents("tr").remove();
    }
    //多值-图片预览
    function morevaluePreImg(id){
        var src=$("#"+id).val();
        $.fancybox({href:src});
    }
    //多值-文件预览
    function morevaluePreFile(id){
        var src=$("#"+id).val();
        window.open(src);
    }
    //多值-视频预览
    function morevaluePreVideo(id){
        var src=$("#"+id).val();
        if(src){
            $.fancybox({
                content:'<div class="fancybox_video_play"><video  style="width:800px;height:auto" id="fancybox_video_src" src="'+src+'" autoplay controls></video></div>',
            })
        }else{
            layer.msg("视频路径为空");
        }
    }
    //多值-textarea点击放大的效果
    function moreBigTextarea(obj,type){
        layer.prompt({
            title:"内容编辑区域",
            formType: type,//1, //输入框类型，支持0（文本）默认1（密码）2（多行文本）
            area: ['400px', '240px'],
            value: $(obj).val(),
            btn:['确认']
        },function(value, index, elem){
            $(obj).val(value);
            layer.close(index);
        });
    }
</script>
            <script id="save_form">
    function successFun(){
        parent.location.reload();
    }
</script>
            <script id="js_script">

</script>
        </body>
    </html>